package com.go.where.manager.dao.system.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.go.where.manager.dao.impl.BaseDaoImpl;
import com.go.where.manager.dao.system.PermissionDao;
import com.go.where.manager.pojo.user.Permission;

@Repository("permissionDao")
public class PermissionDaoImpl extends BaseDaoImpl<Permission> implements
		PermissionDao {

	@Override
	protected String getNameSpace() {
		return "mybatis.xml.PermissionMapper";
	}

	@Override
	public int deleteByRoleId(String roleId) {
		return this.getSqlSession().delete(getNameSpace() + ".deleteByRoleId",
				roleId);
	}

	@Override
	public List<Permission> queryByRoleId(String roleId) {
		return this.getSqlSession().selectList(
				getNameSpace() + ".queryByRoleId", roleId);
	}

	@Override
	public List<String> selectByRoleId(String roleId) {
		return this.getSqlSession().selectList(
				getNameSpace() + ".selectByRoleId", roleId);
	}

}
